<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			function addrow() {
				var newrow = document.getElementById("mytable").insertRow(2);//在第2行的位置插入
				var cols1 = newrow.insertCell(0);
				cols1.innerHTML = "幸福从天而降";
				var cols2 = newrow.insertCell(1);
				cols2.innerHTML = "&yen;691";

			}
			function delerow(){
				document.getElementById("mytable").deleteRow(2);				
			}
			function updarow(){  
			    var newrow2=document.getElementById("mytable").rows[0];
			    var col1=newrow2.cells[0];
			    col1.innerHTML="书de名";
//			    var col2=newrow2.cells[1];
//			    col2.innerHTML="价格";
         
			  
			}
			
				
			
		</script>
	</head>

	<body>
	
		<form action="" method="post">

			<table border="1px" id="mytable" >
				<tr>
					<th style="width: 200px;">书名</th>
					<th>价格</th>
				</tr>
				<tr>
					<td style="width: 200px;">幸福从天而降</td>
					<td>180.5</td>
				</tr>
				<tr>
					<td>60个最美瞬间</td>
					<td>998</td>
				</tr>
			</table>
			<input onclick="addrow()" type="button" value="新增一行" />
			<input onclick="delerow()" type="button" value="删除第二行" />
			<input onclick="updarow()" type="button" value="修改标题" />
		</form>
		<br />
		<hr />
		<br />
		
	</body>

</html>